/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package autobazarparser;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

/**
 *
 * @author Ahmad Samir
 */
public class AutoBazarReader {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {

        List<String> al = new ArrayList<String>();

        CarData carData = new CarData("http://avtobazar.ua/poisk/avto/");
        CarPattern carPattern = new CarPattern();
        carPattern.setPattern("Name", Pattern.compile(".fn"));
        carPattern.setPattern("Info", Pattern.compile(".main_info"));
        carPattern.setPattern("Price", Pattern.compile(".price_grn"));
        CarParser carParser = new CarParser();
        al = carParser.parse(carPattern, carData,1);
        
        for (String string : al) {
            System.out.println(string);
        }
    }
}
